const path = require('path');
var HtmlWebpackPlugin = require('html-webpack-plugin');      ////html

module.exports = {
    mode: 'development',
    entry: './src/index.js',
    output: {
        path: path.resolve(__dirname, 'dist'),
        //filename: 'index.js',
        filename: '[name].[contenthash].js',//http 缓存

    },
    plugins: [
        new HtmlWebpackPlugin({
            title: 'zzz',
            template: "src/assets/index.html"
        })
    ]                       ////html
    // output: {
    //     filename: 'my-first-webpack.bundle.js'
    // },
    // module: {
    //     rules: [
    //         { test: /\.txt$/, use: 'raw-loader' }
    //     ]
    // }
};